package com.yygh.hosp.controller;

import com.yygh.common.result.Result;
import com.yygh.hosp.repository.DepartmentRepository;
import com.yygh.hosp.service.DepartmentService;
import com.yygh.model.hosp.Department;
import com.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/admin/hosp/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode) {

        List<DepartmentVo> result = departmentService.findDeptTree(hoscode);
        return Result.ok(result);

    }
}
